<?php
/**
 * Announce Header Block
 * 
 * @package Hive\Mission\Announce
 * @author Xavier VILAIN
 */
use Fox\Html\Button\Help;
use Fox\Html\Input;
use Fox\Dao\SqlFragment;
use Hive\Mission\Announce\Status;
use Fox\Html\DropList;
use Fox\Html\Block;

$xview = Xview::instance();
$language = $xview->language();
$blCarac = new Block('bHeader',Msg(Fox\Msg::BUNDLE,Fox\Msg::MSG_MASTER_DATA));
// Job Reference
$blCarac->add(new Input(array('announce_reference','reference'),true))
		->size(Input::SIZE_MEDIUM);

// Job Offer Status
$status = Fox\Dao::finder(Status::className())
		->where('language = ?',array($language))
		->find();
$blCarac->add(new DropList('status',false,false,true),2)
		->options($status,'status','label');
// Contract Type
//@TODO add customizing point to select only some contract type 
$types = Fox\Dao::finder(Hive\Job\Contract\Type::className())
		->where('active = ? AND loekz = ?',array(1,0))
		->find();
$blCarac->add(new DropList('contract_type',true,false,false))
			->options($types,'type',Fox\Generator::call('label'));

// Contract Time Slot
$blCarac->add(new Input(array('contract_time_slot','timeslot'),false),2,'contract_type');	
/*	
$timeSlots = Fox\Dao::finder(Hive\Job\Contract\TimeSlot::className())
		->where('language = ?',array($language))
		->find();
	
$blCarac->add(new DropList(array('contract_time_slot','timeslot'),true,false,false),2,'contract_type')
		->options($status,'timeslot','label');	
*/
// Study Level
$status = Fox\Dao::finder(Hive\Education\Level::className())
		->where('language = ?',array($language))
		->find();
$blCarac->add(new DropList('education_level',true,false,false))
		->options($status,'level','label');
		
// Experience Level
$blCarac->add(new Input('experience_level',false),2,'education_level')
->size(Input::SIZE_LARGE)
			->add(new Help('experience_levelHelp',Msg(Hive::BUNDLE,Hive::HELP_JOB_EXPERIENCE_LEVEL)));
// Salary
$blCarac->add(new Input(array('announce_salary','salary'),false))
			->size(Input::SIZE_LARGE);
// Localisation
$blCarac->add(new Input(array('job_localization','localization'),false),2,'salary')->size(Input::SIZE_LARGE)
		->add(new Help('experience_levelHelp',Msg(Hive::BUNDLE,Hive::HELP_JOB_LOCALIZATION)));
// Start Date
$blCarac->add(new Input(array('announce_start_date','start_date'),false))
		->add(new Help('announce_start_dateHelp',Msg(Hive::BUNDLE,Hive::HELP_JOB_START_DATE)));

// Duration in case of limited contract
$blCarac->add(new Input(array('job_duration','duration'),false),2,'start_date')
		->size(Input::SIZE_LARGE)
		->add(new Help('job_durationHelp',Msg(Hive::BUNDLE,Hive::HELP_JOB_DURATION)));
		

$blCarac->labelSize('120',true);
return $blCarac;